#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int NumberOf1(int n) {
    // write code here
    int count = 0;
    while (n)
    {
        count++;
        n = n & (n - 1);
    }
    return count;
}
int main()
{
    int n;
    while (scanf("%d", &n) != EOF)
    {
        printf("%d\n", NumberOf1(n));
    }
    return 0;
}
